<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Layout 布局 | MyUI 4.x</title>
    <meta name="generator" content="VuePress 1.5.0">
    <link rel="icon" href="/my/favicon.ico">
    <script>
      var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c4e5f73318b5cb0c389e3d9a05f831cc";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
    <meta name="description" content="MyUI是美亚柏科旗下新德汇出品的Web前端一站式项目工程框架，专注于公检法行业中台系统快速搭建，框架已在多个项目实战检验。">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <link rel="preload" href="/my/assets/css/0.styles.3b7da768.css" as="style"><link rel="preload" href="/my/assets/js/app.145deadf.js" as="script"><link rel="preload" href="/my/assets/js/546.c48d7d92.js" as="script"><link rel="preload" href="/my/assets/js/1296.aba50e54.js" as="script"><link rel="preload" href="/my/assets/js/974.ffa6c050.js" as="script">
    <link rel="stylesheet" href="/my/assets/css/0.styles.3b7da768.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/my/" class="home-link router-link-active"><img src="/my/img/logo.png" alt="MyUI 4.x" class="logo"> <span class="site-name can-hide">MyUI 4.x</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Basic</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/my/element/border.html" class="sidebar-link">Border 边框</a></li><li><a href="/my/element/button.html" class="sidebar-link">Button 按钮</a></li><li><a href="/my/element/color.html" class="sidebar-link">Color 色彩</a></li><li><a href="/my/element/container.html" class="sidebar-link">Container 布局容器</a></li><li><a href="/my/element/icon.html" class="sidebar-link">Icon 图标</a></li><li><a href="/my/element/layout.html" aria-current="page" class="active sidebar-link">Layout 布局</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/element/layout.html#基础布局" class="sidebar-link">基础布局</a></li><li class="sidebar-sub-header"><a href="/my/element/layout.html#分栏间隔" class="sidebar-link">分栏间隔</a></li><li class="sidebar-sub-header"><a href="/my/element/layout.html#混合布局" class="sidebar-link">混合布局</a></li><li class="sidebar-sub-header"><a href="/my/element/layout.html#分栏偏移" class="sidebar-link">分栏偏移</a></li><li class="sidebar-sub-header"><a href="/my/element/layout.html#对齐方式" class="sidebar-link">对齐方式</a></li><li class="sidebar-sub-header"><a href="/my/element/layout.html#响应式布局" class="sidebar-link">响应式布局</a></li><li class="sidebar-sub-header"><a href="/my/element/layout.html#基于断点的隐藏类" class="sidebar-link">基于断点的隐藏类</a></li><li class="sidebar-sub-header"><a href="/my/element/layout.html#row-attributes" class="sidebar-link">Row Attributes</a></li><li class="sidebar-sub-header"><a href="/my/element/layout.html#col-attributes" class="sidebar-link">Col Attributes</a></li></ul></li><li><a href="/my/element/link.html" class="sidebar-link">Link 文字链接</a></li><li><a href="/my/element/typography.html" class="sidebar-link">Typography 字体</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Form</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Data</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Notice</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Navigation</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Others</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="layout-布局"><a href="#layout-布局" class="header-anchor">#</a> Layout 布局</h1> <p>通过基础的 24 分栏，迅速简便地创建布局。</p> <h2 id="基础布局"><a href="#基础布局" class="header-anchor">#</a> 基础布局</h2> <p>使用单一分栏创建基础的栅格布局。</p> <!----><h2 id="分栏间隔"><a href="#分栏间隔" class="header-anchor">#</a> 分栏间隔</h2> <p>分栏之间存在间隔。</p> <!----><h2 id="混合布局"><a href="#混合布局" class="header-anchor">#</a> 混合布局</h2> <p>通过基础的 1/24 分栏任意扩展组合形成较为复杂的混合布局。</p> <!----><h2 id="分栏偏移"><a href="#分栏偏移" class="header-anchor">#</a> 分栏偏移</h2> <p>支持偏移指定的栏数。</p> <!----><h2 id="对齐方式"><a href="#对齐方式" class="header-anchor">#</a> 对齐方式</h2> <p>通过 <code>flex</code> 布局来对分栏进行灵活的对齐。</p> <!----><h2 id="响应式布局"><a href="#响应式布局" class="header-anchor">#</a> 响应式布局</h2> <p>参照了 Bootstrap 的 响应式设计，预设了五个响应尺寸：<code>xs</code>、<code>sm</code>、<code>md</code>、<code>lg</code> 和 <code>xl</code>。</p> <!----><h2 id="基于断点的隐藏类"><a href="#基于断点的隐藏类" class="header-anchor">#</a> 基于断点的隐藏类</h2> <p>Element 额外提供了一系列类名，用于在某些条件下隐藏元素。这些类名可以添加在任何 DOM 元素或自定义组件上。如果需要，请自行引入以下文件：</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">import</span> <span class="token string">'element-ui/lib/theme-chalk/display.css'</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>包含的类名及其含义为：</p> <ul><li><code>hidden-xs-only</code> - 当视口在 <code>xs</code> 尺寸时隐藏</li> <li><code>hidden-sm-only</code> - 当视口在 <code>sm</code> 尺寸时隐藏</li> <li><code>hidden-sm-and-down</code> - 当视口在 <code>sm</code> 及以下尺寸时隐藏</li> <li><code>hidden-sm-and-up</code> - 当视口在 <code>sm</code> 及以上尺寸时隐藏</li> <li><code>hidden-md-only</code> - 当视口在 <code>md</code> 尺寸时隐藏</li> <li><code>hidden-md-and-down</code> - 当视口在 <code>md</code> 及以下尺寸时隐藏</li> <li><code>hidden-md-and-up</code> - 当视口在 <code>md</code> 及以上尺寸时隐藏</li> <li><code>hidden-lg-only</code> - 当视口在 <code>lg</code> 尺寸时隐藏</li> <li><code>hidden-lg-and-down</code> - 当视口在 <code>lg</code> 及以下尺寸时隐藏</li> <li><code>hidden-lg-and-up</code> - 当视口在 <code>lg</code> 及以上尺寸时隐藏</li> <li><code>hidden-xl-only</code> - 当视口在 <code>xl</code> 尺寸时隐藏</li></ul> <h2 id="row-attributes"><a href="#row-attributes" class="header-anchor">#</a> Row Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>gutter</td> <td>栅格间隔</td> <td>number</td> <td>—</td> <td>0</td></tr> <tr><td>type</td> <td>布局模式，可选 flex，现代浏览器下有效</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>justify</td> <td>flex 布局下的水平排列方式</td> <td>string</td> <td>start/end/center/space-around/space-between</td> <td>start</td></tr> <tr><td>align</td> <td>flex 布局下的垂直排列方式</td> <td>string</td> <td>top/middle/bottom</td> <td>top</td></tr> <tr><td>tag</td> <td>自定义元素标签</td> <td>string</td> <td>*</td> <td>div</td></tr></tbody></table> <h2 id="col-attributes"><a href="#col-attributes" class="header-anchor">#</a> Col Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>span</td> <td>栅格占据的列数</td> <td>number</td> <td>—</td> <td>24</td></tr> <tr><td>offset</td> <td>栅格左侧的间隔格数</td> <td>number</td> <td>—</td> <td>0</td></tr> <tr><td>push</td> <td>栅格向右移动格数</td> <td>number</td> <td>—</td> <td>0</td></tr> <tr><td>pull</td> <td>栅格向左移动格数</td> <td>number</td> <td>—</td> <td>0</td></tr> <tr><td>xs</td> <td><code>&lt;768px</code> 响应式栅格数或者栅格属性对象</td> <td>number/object (例如： {span: 4, offset: 4})</td> <td>—</td> <td>—</td></tr> <tr><td>sm</td> <td><code>≥768px</code> 响应式栅格数或者栅格属性对象</td> <td>number/object (例如： {span: 4, offset: 4})</td> <td>—</td> <td>—</td></tr> <tr><td>md</td> <td><code>≥992px</code> 响应式栅格数或者栅格属性对象</td> <td>number/object (例如： {span: 4, offset: 4})</td> <td>—</td> <td>—</td></tr> <tr><td>lg</td> <td><code>≥1200px</code> 响应式栅格数或者栅格属性对象</td> <td>number/object (例如： {span: 4, offset: 4})</td> <td>—</td> <td>—</td></tr> <tr><td>xl</td> <td><code>≥1920px</code> 响应式栅格数或者栅格属性对象</td> <td>number/object (例如： {span: 4, offset: 4})</td> <td>—</td> <td>—</td></tr> <tr><td>tag</td> <td>自定义元素标签</td> <td>string</td> <td>*</td> <td>div</td></tr></tbody></table></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/my/element/icon.html" class="prev">
        Icon 图标
      </a></span> <span class="next"><a href="/my/element/link.html">
        Link 文字链接
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/my/assets/js/app.145deadf.js" defer></script><script src="/my/assets/js/546.c48d7d92.js" defer></script><script src="/my/assets/js/1296.aba50e54.js" defer></script><script src="/my/assets/js/974.ffa6c050.js" defer></script>
  </body>
</html>
